import request from '@/utils/request'

export function getRoles(params) {
  return request({
    url: '/sys/role',
    method: 'GET',
    params
  })
}
export function delRoles(id) {
  return request({
    url: '/sys/role/' + id,
    method: 'delete'
  })
}
export function addRole(data) {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}
export function updateRole(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data
  })
}
export function getRoleDetail(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'get'

  })
}
export function assignPermission(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data

  })
}
